/**
 * ...
 * @author Thot
 */

function SelectMapCommand(){}; 
POO.extend( SelectMapCommand, Command );



SelectMapCommand.prototype.execute = function( p_notificationType, p_data )
{
	var facade = ApplicationFacade.getInstance();
	var appProxy = facade.getProxy( ApplicationProxy.NAME );
	var mapProxy = facade.getProxy( MapProxy.NAME );
	appProxy.currentMap = p_data;
	
	facade.sendNotification( ApplicationNotification.CLEAN_MAP );
	facade.sendNotification( ApplicationNotification.CLEAN_LAYERS );
	facade.sendNotification( ApplicationNotification.DISPLAY_MAP_LAYERS );
	facade.sendNotification( ApplicationNotification.DISPLAY_MAP_ANIM );
	
	//var mapVO = mapProxy.getMapVOById(appProxy.currentMap);
	//var layerVO = null;
	//var i = 0;
	//var j = 0;
	//var max = mapVO.layers.length;
	//var max2 = 0;
	//var body = null;
	//var disp = null;
	//
	//for( i = 0; i < max; i++ )
	//{
		//layerVO = mapVO.layers[i];
		//facade.sendNotification( ApplicationNotification.ADD_LAYER, layerVO.name );
		//
		//
		//disp = layerVO.displayList;
		//max2 = disp.length;
		//
		//for( j = 0; j < max2; j++ )
		//{
			//body = new Object();
			//body.animId = disp[j][7];
			//body.x = disp[j][0];
			//body.y = disp[j][1];
			//body.layerId = layerVO.name;
			//
			//facade.sendNotification( ApplicationNotification.ADD_ANIMATION, body );		
		//}
	//}
};